<?php

namespace common\models\keyword;

use Yii;

/**
 * This is the model class for table "{{%keyword_relation}}".
 *
 * @property int $id
 * @property int $lib_id 分词ID
 * @property string $model 模型标识
 * @property int $model_id 模型ID
 */
class KeywordRelation extends \common\base\ActiveRecord {

    const MODEL_GOODS = 'goods';

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%keyword_relation}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['lib_id', 'model_id'], 'integer'],
            [['model'], 'required'],
            [['model'], 'string', 'max' => 50],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'lib_id' => '分词ID',
            'model' => '模型标识',
            'model_id' => '模型ID',
        ];
    }

}
